package bb.lanxing.lib.devices.ble.ble.characteristic;

import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import bb.lanxing.lib.devices.ble.ble.base.BaseBleCharacteristic;
import bb.lanxing.lib.devices.ble.ble.base.BaseBleService;
import bb.lanxing.lib.devices.core.ble.SpecificationAttributes;
//import bb.lanxing.lib.devices.sprint.coroutines.DeviceCoroutinesScopeeKt;
import java.util.UUID;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.flow.MutableStateFlow;
import kotlinx.coroutines.flow.StateFlowKt;

public final class BatteryStatusCharacteristic extends BaseBleCharacteristic {
    private MutableStateFlow<BatteryStatus> batteryStatus;

    public BatteryStatusCharacteristic(BaseBleService bleService) {
        super(bleService);
        Intrinsics.checkNotNullParameter(bleService, "bleService");
        this.batteryStatus = StateFlowKt.MutableStateFlow(BatteryStatus.Reserved);
    }

    public MutableStateFlow<BatteryStatus> getBatteryStatus() {
        return this.batteryStatus;
    }

    public void setBatteryStatus(MutableStateFlow<BatteryStatus> mutableStateFlow) {
        Intrinsics.checkNotNullParameter(mutableStateFlow, "<set-?>");
        this.batteryStatus = mutableStateFlow;
    }

    @Override
    public UUID targetUUID() {
        UUID BLE_BATTERY_STATUS_CHARACTERISTIC = SpecificationAttributes.BLE_BATTERY_STATUS_CHARACTERISTIC;
        Intrinsics.checkNotNullExpressionValue(BLE_BATTERY_STATUS_CHARACTERISTIC, "BLE_BATTERY_STATUS_CHARACTERISTIC");
        return BLE_BATTERY_STATUS_CHARACTERISTIC;
    }

    @Override
    public void onValueUpdate(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
//        Intrinsics.checkNotNullParameter(gatt, "gatt");
//        Intrinsics.checkNotNullParameter(characteristic, "characteristic");
//        BuildersKt.launch$default(DeviceCoroutinesScopeeKt.getDeviceStateScope(getBleService().getDevice()), null, null, new BatteryStatusCharacteristic$onValueUpdate$1(this, characteristic, null), 3, null);
    }
}
